IN THIS ISSUE
NOVEMBER 1982
History - First Lady oT Computtrs
Editor Rambling*
Chsss For The Sinclair
The Corip u tor Tutor - String Manipulation
Hose Budget Programs - Review ..........
Letters To The Editor ..................
Short Programs
is published monthly by:
The S&S Company
388 West Lake Street
Addison, Illinois 60101
(312) 628-8955
: s : 1 1 1 i s : : s : s s s s * m i i : s s s s s : : : s : s s : s * i s : s s s s : s s : : s : : i :: : s : s s
VQTEH is a complete package,
consisting of the hardware
and software to enable your
computer to measure voltages
and temperatures. VGTEM
also includes circuitry that
"cleans up" the tape signal
for dependable LOADS.
VOTEK transforms your system
into a "smart" digital volt-
meter or thermometer with
storage capability or even a
data acquisition sytemJ l l
ANALOG INTERFACE FOR THE 2X81
* Requires absolutely no modifications to computer
* Probe provided for air and liquid temprature measurements
* Voltage range of + IV is expanded with on-board resistors
* Bet t er-than-14-bit resolution (0.00004V or 0.05 degrees)
* Low power » requires less than 20mA at +11V unregulated
* Can be powered from computer's supply (cable included)
* Ta P e signal conditioning and monitoring circuitry
* 35 -page, easy-to-follow, comprehensive user's manual
. Cau^ be purchased alone $5 and applied to 1st V O T E M
. Includes software for calibration and applications
. Instructions for adapting to other 280 systems
$39.95 (kit) or $59.95 (asm & tested)
Kail check or money order. Please add $3 postage /handling.
Down East Computers // PO Box 3096 // Greenville, NC 27834,
What did the poet, Lord Byron
have in canon with the computers we
have today?
Probably nothing personally, but
he was the father of Lady Augusta
Ada 8yron Lovelace, who becane a
pioneer in early computer
technology.
The story goes that Lord Byron
left his wife and daughter when
Augusta was just an infant. In the
tradition of society of that period
of history, she was strictly raised
by her mother and educated at hone
in the classical subjects of that
time.
Augusta demonstrated a great
affinity for mathnatics and while
still a teenager, married Lord King
in 1835 who later becane the Earl of
Lovelace. He helped her in her
interest in mathematics and through
THE FIRST LADY
OF COMPUTERS
him. was introduced to Diaries
Babbage.
Now. Charles Babbage had invented
a calculating machine that is
considered by most as being the
first device that had computing
capabilities and was christened The
Analytical Engine. This machine
could compute equations to 21
decimal places and worked on a
system of rods and levers.
Lady Lovelace became enthralled
with the device, and in 1842 she
translated a paper about the engine
from French to English and added
many of her own thougits to the
translation. She was the first
person to describe terminology such
as Subroutines and Loops - concepts
accepted today in almost every
computer language and yet about one
hundred years before their
implimentation.
Hr . Babbage and Lady Lovelace
becane close friends and partners
for many years in their joint effort
with the Analytical Engine.
Lady Lovelace never received true
recognition for her efforts because
of the anti-feminist attitudes of
that tine. She was also a compulsive
ganbler on horse races. History does
not record whether she used the
Analytical Engine to predict the
outcome of any of those races.
The story ends sadly as Lady
Lovelace developed cancer and died
at the age of 3d.
GROWTH OF SYNCHRO-SETTE
We, like many supporting
companies For the Sinclair
computers, are suffering from
growing pains. Ue have increased our
staff and still are having problems
meeting deadlines. The most obvious
result of this is how late our
issues Keep coming out. Our goal is
to have all of our customers receive
their current issues by the first
week of the nonth. The old adage,
THE HURR1EDER 1 GO, THE BEHINDER I
GET has never been more applicable.
1 used to think that it wasn't much
more work to prepare a magazine for
IMS subscribers than it was for
108, Boy was 1 wrong. The phones
ring constantly and most calls are
long distance. People are asking us
for information in every possible
area besides our own products. The
most common inquiry regards
printers.
Ue feel since these people are
investing in a long distance call,
we should try to give then as much
information as possible. Ue also
receive many inquiries by nail,
currently over 4000 per month and
growing alt the time. This means
that the staff and myself cannot
dedicate the tine each day that is
necessary to meet our deadlines and
commitments. 1, myself am spending
on the average between 12 to 14
hours per day, six days a week
trying to keep pace. Ue are trying
desperately to get the next issue
out so that you will receive the
magazine and cassette before the
holidays. Please bear with us for
the late issues because we feel that
we are finding ways and means to
improve this situation.
AMATEUR RADIO AND
THE SINCLAIR COMPUTER
OZX is a Journal covering amateur
radio and the Sinclair family of
computers, e.g. ZX-80, Micro -Ace,
ZX-81 and the T/S-10B0 and is
designed for owners of these
computers who are licensed radio
amateurs.
The subscribers to this
publication talk to the entire world
using their computers to perform
some facet of the communication.
The newsletter is a continuation
of the one that was started by Marty
Irons, was published 4 times a year
and was sent to about 258
subscribers. The new management
estimates present membership af over
360.
To find out more information
about this exciting new field of
communications, contact:
0X2
2625 O'Donnell Drive
Las Cruces, N. Mexico, 83001
n
T
■4
Anbrose 'Bo' Barry, U4GW/5
Editor
Alex F. Burr, K5xy
Publisher
COMPUTERS IN SCHOOLS
Many schools are wondering what
computers are the best tor teaching
First timers, The T/S-1IB0 and ZX-8I
is usually at the top oF the list
because oF price. The drawbacks,
however, Fall mainly into two
categories:
A * The Sinclair machines are not
taken seriously because oF their
size and the membrane keyboard. The
competition has propagated the myth
that they are just toys and the
users will soon outgrow their
capabilities.
B - They do not have many oF the
Frills their more expensive
counterparts have, such as color,
high resolution graphics and sound,
all oF which are important to the
development oF user's computer
literacy.
Bunk - nothing could be Further
From the truth! The size and
membrane keyboard is actually an
advantage in that the computer is
less susceptible to damage From key
contacts being exposed to the
a Ionosphere, dirt and spillage such
as in the non-membrane competitors.
IF damage does occur, the repair or
replacement bill will be much
smaller than For the competitor's
models.
The Frills such as sound, color
and high-resolution graphics have
little place in the real world,
except in arcade games and maybe
Fancy business graphs.
This little computer is actually
a very powerFul and dynamite little
machine.
But putting all that aside, one
area that has been almost cwipletely
overlooked is the teaching oF
computer science to that age group
that should be the youngest to be
exposed to it, mainly the 5th thru
8th grades oF grander school.
This group has been demonstrated
to have problems with certain motor
responses, that is, hand to eye
co-ordination using a typewriter
keyboard more so than their older
peers. It has been shown that when
groups oF the same age level were
given the use oF Sinclair computers
versus other more expensive and
elaborate computers with all the
bells and whistles, the Sinclair
group oF users learned Faster and
retained more EVEN IF THEY MD TAKEN
A PREVIOUS CLASS WITH THE OTHER
COMPUTERS.
Why? What was this magic that
Uncle Clive was able to weave?
Think oF it logically. What is
the one thing that the T/S-10IB and
the ZX-6I have, that the competition
doesn't?
Single key-stroke command input!
That's right. Put yourselF in the
place oF a IS or 11 year old. You
probably never touched a typewriter
beFore For any serious reason and
now you are placed in Front oF a
computer and expected to type in
programs. You are constantly reading
a list oF program lines, hunting For
the proper keys to press and then
checking the screen to see iF the
input was correct. Heauen help you
iF it didn't. You would have to
backspace, again the eyes constantly
Flitting between the screen and the
keyboard white the Fingers are
trying to do the right thing.
To put in a command such as PRINT
requires 5 keystrokes. The same with
the command INPUT. On the Sinclair
machines it only requires 3
keystroke, not just For these
ccmands out all commands, Functions
and logical operators. The end
result is that the youngster has
less to do and is rewarded sooner
For his or her eFForts. This means
that impressions are made in the
child's mind within a shorter time
From the initiation oF the efFort to
the keyboard and the attention span
tine required is shorter.
The child retains none of what's
happening.
Isn't this oar goal, whether we
be a responsible parent or teacher?
Would not the sane principles apply
to the teaching of adults?
Uhen Radio Shack first introduced
the 7RS-88 , it had a short-hand
BASIC language that abbreviated
alnost all of the comands. It was a
stnple language to understand and
could accomplish many things.
They later introduced their Level
II BASIC conversion kit, which
pronised to turn that conputer into
a very powerful machine - which it
did. This language even today in my
opinion is still the most pouerful
BASIC language there is.
The only problem was that the
difference between the two languages
was like night and day. It was 1 ike
graduating from gramer school and
going directly into a university.
The manual that came with the kit
wasn't much help to the uninitiated,
either. There was no index. Some
people even made money s imply by
writing an index for the manual and
selling it through classified ads.
The manual was termed a User's
Manual. This meant that users were
expected to read it cover to cover
and correlate the information to
previously learned languages from
other computers.
The buying public that converted
their machines was for the most part
unaware of what they were in store
for. Many of them wanted the old
ROMs put back in the computers or
simply sold them.
Many, though, were irreversibly
bitten by the computer bug and
trudged on, forcing themselves to
learn the new language through trial
and error, not to mention excessive
phone calls to the more learned
and/or purchase of anything they
could get their hands on that would
help their cause.
In those days there was very
little help. Thank God those days
are behind us now. Books,
publications, places to call, etc.
all exist now, at least more so than
they did then, and we're only
talking 4 years ago. The Sinclair
computer's BASIC language is very
similiar to the TRS-Brs.
1 have used and taught
programing classes on almost all
the popular computers until 1981 and
I firmly believe the quickest way to
achieve computer literacy is on a
machine that has single keystroke
entry of all the multi-character
commands, functions and logical
operaters and the only computers
that ] am aware of that have these
features are the ones from Uncle
Clive.
UATCHttKER'S GUIDEBOOK
TS6 Enterprises has just released
a resource book for the T/S-1888
computer. The book is called 'The
Watchmaker's Guidebook to the
7JMEX/S1NCLAIR Computers' and is
available by mail-order from:
TSG Enterprises, Guidebook
54 Richwood Place
Denville, NJ, 87634
for 3.95 plus 1.88 postage &
handling. The book is 44 pages and
contains a directory of suppliers
with a brief description of their
wares. About 128 software suppliers.
58 hardware suppliers and 28
ancillary suppliers are included. In
addition, tne Guidebook contains
directories of user groups, of
TIMEX./ SINCLAIR specific magazines
and books and an index to articles
appearing in general personal
conputer maoazines about the
T1MEX/S1NCLAIR computer. Also
included in the Guidebook is an
introductory chapter about writing a
proQram in BASIC.
(CONT. PAGE 15)
7
CHESS FOR THE SINCLAIR COMPUTER
Many people purchase hoee
computers for the prime purpose of
entertainment. The thought of having
a game playing partner that not only
provides a constant challenge but is
available at the convenience oF the
user is a i»ost attractive
conbi nation.
Chess, through the years, has
been a game popular with people in
all walks oF 1 if*. Computer chess is
not only attractive For these
reasons, but it usually oFFers
different levels oF challenge and
also presents the unique capability
oF not gloating when it is
victorious (Boris chess computers
non-withstanding).
The First commercially available
chess computer was marketed by
Fidelity Electronics in Chicago in
1976 For <175. It was called the
CHESS CHALLENGER and played awFpl
chess. But what made it unique is
that it could play chess and always
made legal moves.
AFter some months, the CHESS
CHALLENGER 3 was introduced and
owners of the original model could
have theirs upgraded to perform like
the new model which had 3 levels oF
diFFiculty. It wasn't long beFore
other companies started marketing
their nodels and an entirely new
QR QN QB Q K KB KN KR
A B CD £ F G H
market prol iterated.
The First version on tape that I
am aware oF which was available For
desk top computers commercially was
MICRO-CHESS, which came out For the
TRS-88 and later the PET and APPLE.
None of these programs represented a
serious challenge until SAR60N-2 (on
tape) and the CHESS CHALLENGER-18
(dedicated chess playing computer)
became available in late 1977.
These programs were unique in
that they could see nany plys (halF
moves) ahead compared to their
predecessors and had routines that
could sacrifice and play For
position. They quickly became
champions in all the microcomputer
tournaments and even Fared well by
defeating some oF the mainframe
computer programs in the large
computer chess tournaments.
Since that time, these programs
have been improved to the point
where there is a commercially
marketed chess computer From
Fidelity Electronics (now in
Florida) that uses a new version of
the Sargon programs that plays chess
at a U.s. Chess Federation level of
over 1808 in 2 to 3 minute moves.
This is good enough to beat over 99X
of the chess playing public the
majority of the lime.
There are a Few chess programs
7 *
< BLACK
available for the Sinclair computer
too. Gladstone Elec tonics, (1-888)
833-8410, sells three of then of
which the best is called ZX CHESS 11
CHESS MASTER. This program is
ctained to be the strongest chess
game to be available on the ZX-81
and has many features including
saving a game on tape to be resumed
later, printing the isoves on the
screen or printer and board set-up.
16 Al-Cl
1? ci-ez
18 A2-A3
19 C2-02
28 D2-C2 ?
88-08
68-86
0*0
Hi-54
F8-E8 ?
20 F7-F6 seens to have
more merit in an attempt to remove
the oppresive pawn at E5.
21 F3-D2 64-Hi
In case you are not familiar with
computer chess notation, the board's
64 squares are identified by
co-ordinates. The board is lettered
from A to K left to right and from 1
to 8 button to top. Uhite always
plays at the bottom of the board and
black from the top. A move such as
King's pawn from the second row to
the fourth row woulds be E2-E4, The
E is for the letter of the fifth
col win where the King normally
resides.
These statements regarding the ZX
Master progran seemed to me to be
pretty strong claims, so 1 decided
to have a tournament between this
progran and SARGON 2 on the TRS-80.
I set the levels on each computer to
nake each move in an average tine
between 2 to 3 minutes. I did not
keep a record of the tine each
progran took for any of the moves or
the ganes but I had then play 2
ganes against each other, each
playing white once and black once
and the following are the results
with my annotations:
6ane I)
White - ZX Master,
Black - Sargon 2
E2-E4
D2-D4
81-02
E4-E5
G1-F3
F1-D3
0-8
01- E2
02- 83
II Cl -02
11 FI -El
12 02xB4
13 C2-C3
14 83-A5
15 A5-B3 ?
E7-E6
07-05
58-Fi
Fi-Gfl
B8-C4
FB-E7
C8-07
A8-88
C6-B4
07- C4
B7-B5
E7xB4
B4-E7
08- 07
A7-A6
Too nany wasted moves on bath sides
and it doesn't stop!
22 02-F3 H6-G4
23 F3-D2 S4-E5 ??
The -first big mistake by Sargon. I
was all set to reset both conputers
to higher 'tine levels because of
move repetition when this move was
made. Suprisingly, Sargon played a
pretty stong game and actually had a
fair attack going at a later point
in this game and then it made its
second big mistake.
24 E2xE5 E7-F6
Try as you may to find one but black
has no redeeming attack!
25 E5-F4
07-D6
26 F4-E3
E6-E5
Applause,
Applause!
27 E3-G3
E5-E4
28 63x06
08x06
29 D3-F1
C6-D?
38 E1-E3
F6-G5
31 E3-E1
Best move available for white.
Staying on
i the 3rd rank loses the
rook because of - 31 E3-G3
G5-F4.
31
F7-F5
32 B3-C5
G8-F7?
Both of
these programs seen to
prefer using the King as an
attaching
piece. I would prefer
pushing s<m of the back -row pawns.
33 C5-87
D6-G6
34 D2-B3
S5-F4
35 87-C5
E8-E7
Both programs don't sot* to wind
trading pittas that could becae
essential in an attack.
3d C5xD7 E7xD7
IK course, 2 rooks can do aore
danage than a bishop and a rook. The
potential attack looks eery strong
bot it neeer aateria) im and not
because of superior play by White.
found that at this leeel.it could
solve any Naie-In-Two problea that I
gave it in less than 3 ninutes and
over 75! of then in less than 2
ni notes. 1 was sure that the match
would redeew Sargon and restore ay
confidence.
Bane 12
White - Sargon 2, Black - ZX Master
37 83-C5 07-06
38 A3-A4 85xA4
39 C5xA4 A6-A5
Black should have concentrated on
doubl ing up the rooks!
41 C3-C4 66-K6
41 62-63 H6-G6
42 F1-H3 F7-F6
43 H3-62 D5-C4
The second idiot nove of the gane
by Black. The attack it had going
was adlirable considering it was
down a piece. This oove has
absolutely no redeming value. The
potential for the Xing-side attack
is gone unless White nakes a
stupendous blunder which it
doesn't.
44 63xF4 06x04
45 El-CI F6-E7
46 C2xC4
Crabs!
1 C2-C4
2 61-F3
3 61 -A3
4 B2-B3
E2-E3
CI-B2
F1-E2
61 -Cl
0-0
5
6
7
B
9
II 02-64
C7-C6
68-F6
E7-E6
07-D5
F8-C5
08-E7
0-0
C8-07
C5xA3
The first strong nove by Sargon.
attempting to break up Black's board
center control and establish its
11 B2xA3 A6-B4
Good counterplay!
12 A3xB4 E7xB4
13 Fl-Dl D5xC4
14 ClxC4 B4xC4
How these programs like to trade,
nakes no difference whether they are
ahead or behind.
04xC4
47 ClxC4 G6-64
48 C4xC7 ch
And White even gets back the pawn!
E7-06
49 C7-A7 G4xF4
More crabs!
SI A7xA5
15 B3xC4
16 Al-BI
AB-08
07-C8
Black's B7-B5 wakes more sense with
the potential to liberate the
bishop.
17 F3-E5 F6-E4
18 01-03 F8-08
19 E2-F3 E4-65
21 F3-H5 E8-E7
Black is no natch for White's
superior forces and goes on to be
nated on the 81st wove in a rather
dull end-ganc.
1 was very disappointed in
Sargon's play in this game. 1 have
The plan behind this last nove
escapes ne.
22 A2-A3
As does this one.
(CQNT. PAGE 17)
tAe &Mn/wUek 9lUok
see
i
Good afternoon class. . »
you're all looking fit today
Today's subject will be on string
manipulation.
Can anyone give me an example of
string manipulation? Yes, the
gentleman in the rear has his hand
up,
No, that's wrong - and please put
that yo-yo away. That's not the kind
of string we're discussing here
today.
computer will hold. Then press the
ENTER key. The appearance of
movement of the message occurs, but
in actuality, a string of 32
characters is constantly being
thrown on the screen, changed,
thrown again on the screen, changed,
etc.
The message is not really moving
but only gives the illusion of
movement. Ue can get the same
illusion in the opposite direction
by changing line 48 to read;
No, the strings I'm interested in
are string variables in SASIC
computer programs, such as the
BULLETIN BuARb programs and the HONE
BUDGET programs. Let me ask another
question. Tjhat would be the minimum
amount of program lines needed to
allow a MARQUEE type message scroll
across the screen on the Sinclair
computer?
One person says 28 - another 15 -
still another 13.
Would you believe it could be
done in five? That's right, five.
ENTER the following program into
your computer:
SCROLLING DEMO PROGRAM
18 INPUT AS
28 LET AS * 1 32 blank spaces *
♦ M e ■ 1
38 PRINT AT II. Ij A*( TO 32 )
48 LET A* = A8(2 TO LEN MM
AS<)>
58 GOTO 38
RUN the program and ENTER any
message you want or as much as your
48 LET AS * AS(LEN AS) + AS( TO
LEN AS -1)
Instead of RUNning the program
again and retyping in the message,
just ENTER the comand - GOTO 38. Of
course, we are not limited to just
alpha-numeric character entry. We
can also introduce graphic
characters to produce seme pretty
startling effects. The beginning of
last month's cassette program
'BULLETIN* used two of these
routines to intoduce the Bulletin
Board.
Pretty nifty, huh? This is one
method we can use to manipulate
string variables.
There are others, though, such as
word processing. Let us say that we
had a word processor such as the IK
•MICROPRO* on last month's cassette.
This program created one variable
that could be increased or decreased
in length.
But, what if we wanted to insert
a word into that string variable?
Enter the following simple program:
l e
WORD PROCESSING D98Q PROGIWi
H LET C8 = 1 *
111 LET At = INKEY"*
121 IF CODE At =114 THEN
GOSUB 311
131 IF CODE At - 115 THEN
GOSUB 486
141 IF CODE At - 23 THEN
LET At = ' '
151 IF CODE At = 228 THEN
GOSUB 588
198 IF CODE At>63 THEN
LET At = "
208 LET Bt = Bt ♦ At
211 PRINT AT 11.8 : Bt: AT 12,
L84 Bt; CHRt 138; AT 12.
LEN Bt: ' *i AT 11 ,LEN Bt; Ct
228 GOTO 118
388 LET Ct - Bt(LEN Bt) 4 Ct
311 LET Bt = 8t(T0 LEN Bt -1)
328 LET At ="
331 RETURN
488 LET Bt * Bt 4 Ct(l)
418 LET Ct = Ct(2 TO LEN Ct)
428 LET Al = "
438 RETURN
588 LET Ct = Ct<2 TO LEN Ct)
518 LET At = "
528 RETURN
RUN this program and enter the
following sample text one character
at a tine.
■HELLO, HOW ARE YOU?'
This progran will only allow one
line of text to be entered on the
screen, The b) inking cursor appears
under the next character position to
be inputted,
INSERTION - To insert text into
existing text, just place the cursor
under the position of the text where
you want the text to be inserted. An
example would be under the <A) in
(ARE) and type in 'THE HECK See
how easy it is?
This is all done by manipulating
the string variables, <B8> and (C$J
with the (TO) function. For you nore
experienced programs rs it should be
a good exercise to try to conbine
these techniques with some of the
other word-processing routines and
R programs from our past issues to
reduce a word-processor that can
old many lines of text,
As you can see from these
examples, the (TO) function is an
extremely powerful string
manipulating device. Not only is it
powerful but also extremely fast,
even in the SLQU mode. Host word
processors have to be written in
machine language in order to get the
speed necessary to make them
workable, It is my belief that
because of the speed and power of
the <T0> function, a very fast word
processing program could be written
in BASIC that would have most if not
all of the features of established
programs for other microcomputers,
such as the ELECTRIC PBfCIL and
SCR1PTSIT programs, These other
programs can sell for 8188 and
more.
But be that as it nay. let us
move on to other uses for string
manipulation.
CURSOR LEFT & RIGHT - The SHIFT
arrows allow the cursor to move left
or right through the text. You will
notice that if you hold any
character key down, the character
will repeat itself.
DELETE - To delete a character,
press the SHIFT key and the (0)
key.
DATA FORmniNG
In past issues and from cassette
a rams, we have learned that if we
ed to create a list of data,
such as a customer file, we would
have to have separate variable
arrays for every item category to be
inputted. The man in the rear has
his hand up again. Yes sir?
BLANK SPACE - To put a blank space
in, press the SHIFT key and the
asterisk («> key. CAUTION - Do not
press BREAK or SHIFT R16KT ARROW for
a blank space.
He wants to know what a variable
array is. Good question.
ARRAYS
1 1
An array is a word used to format
a category of variable iifomation.
Let us say that we took our little
address book that we all have either
on our person or at hose and we
wanted to put all those names,
addresses, phone numbers and other
related information into the
computer's memory. Let us say that
we never expected the list to exceed
IBB people. In the FILE program on
the 0CT/B2 cassette, we find This is
accomplished by dimensionalizing out
a string variable tor each item to
be entered using the format DIM
Nl(lll,n) where <W> would be the
string variable assigned to the
particular item entered, the <1BB)
is the maxiiun amount ot those items
that will be entered and <n) would
be a number that would represent the
maximum amount of characters in that
item. Ut now have the format set for
the creation of an array to allow
the input of a maximum af 111 items.
Let us say that this array is for
last names.
But, what if we needed more than
one set of items, such as another
array the input of a maximum of 111
first names and other separate
arrays for addresses, phone numbers,
cities or towns, zip codes, etc. Ue
would need to dimensional ize more
string var i abl es, one for each
category of items that we have and
using up one letter of the alphabet
for each category.
Can anyone tell us what the limit
would be to the amount of arrays we
can have in a program? Yes, the
gentleman in the rear has his hand
up again?
He says that after the 2 4 letters
of the alphabet are used up, no more
arrays can be created.
Once again, your answer is wrong,
sir, but I can easily understand how
you came to that conclusion. There
is another method which allows you
as many variables as the cmHuter's
memory will allow, but first let me
discuss some of the methods used on
some of the more expensive computers
with disk drives.
Bata storage and retrieval from
disk can be done with two different
methods. Sequential storage and
retrieval requires all data to be in
the computer s memory banks as it is
being processed. This means that in
a name and address program, all the
name and address information is in
the computer and is available for
recall from the computer's memory
chips.
fttsdom Access data storage works
on an entirely different principal.
The total data is aever entirely in
the computer's memory banks - only
the data which is pertinent to the
operation of that pvt of the
program. The program allows the data
to be inputted and then stores it on
the disk. The program then forgets
the data and moves onto the next
input. Uhen the data is to be
retrieved, it is displayed on the
S or printed onto paper and then
gotten. Sometimes routines in the
program exist to total numeric
values.
The advantage of Random Access
storage is that the disk storage
media can hold a lot more data than
the computer's memory can, the
advantage being maybe II, 21 or 111
times as much. The disadvantage is
that program totaling routines
require the disc drive To always be
running so that it is searching for
the required data and is therefore
more fine-consuming. This is
particularly true for sort routines
That require disk var table
swapping.
You are probably wondering what
any of this has to do with more than
24 variable arrays being available
for the Sinclair computer. The
reason I brought all this up is
because of the methods used for
Random Access storage where a whole
bunch of string var tables can be
stored in one main string variable.
FIELDS, ELENBftS AW SUB -VARIABLES
BITER the following program:
18 CLS
28 IF LEN AW THBt 60T0 5
38 PRINT! , , At
48 FOR H - 1 TO LEN A*
58 PRINT N}
48 NEXT N
78 PRINT 'FIRST NUMBER?'
88 INPUT A
98 IF A<1 OR A) LEN At THEN
GOTO 88
188 PRINT .,,, 'LAST NUMBER?'
118 INPUT B
120 IF B( LEN At - A THEN
GOTO lie
130 PRINT At<A TO B)
148 GOTO 5
RUN this program and BITER a
string ol characters no more than 9
characters in length. Alter you
press the ENTER key, you Mill see a
number under each character
corresponding with that character's
position in the string. The program
will now allow you to break out a
segment ol that string Iron the
lirst nunber entered to the last
number entered. The program will
recycle so that you can try it over
again,
The gentleman in the rear has
another question. Yes, sir?
He asks il this isn't the exact
opposite ol what we set out to
accomplish? He says that he can see
how a string ol characters can be
broken apart but is wondering how
sets ol strings ol characters can be
brought together into one common
lormatted variable?
Patience, my Iriend. Ue must
crawl belore we walk and roll belore
we crawl. ENTER the lollouing
program:
FIELD PROGRAM
18 DIM A4C5.32)
28 FOR N s i TO 5
38 SCROLL
48 PRINT 'NAME?',
58 INPUT W
48 LET AS(N, TO 12) = BS
78 PRINT Bt
88 SCROLL
98 PRINT ‘ADDRESS?* ,
188 INPUT 8$
HI LET A4<N,13 TO 24) * B4
120 PRINT B4
130 SCROLL
140 PRINT 'PHONE NO.?',
158 INPUT 84
148 LET A4<N,25 TO 32) - BS
178 PRINT 64
188 SCROLL
198 SCROLL
281 NEXT N
218 SCROLL
228 SCROLL
238 PRINT 'PRESS ENTER TO
SEE VARIABLES
248 SCROLL
258 SCROLL
248 SCROLL
278 INPUT B4
268 FOR N - 1 TO 5
298 SCROLL
388 PRINT A4(N)
318 SCROLL
328 PRINT '12345478981234547898
1234547B9812'
338 SCROLL
341 SCROLL
358 NEXT N
341 SCROLL
378 SCROLL
388 PRINT 'PRESS ENTER TO SEE
SEGMENTS :::'
398 INPUT B4
488 SCROLL
418 SCROLL
428 FOR N - 1 TO 5
438 PRINT 'NAME',A4(N, TO 12)
448 SCROLL
458 PRINT •A00RESS',A4<N I 13
TO 24)
448 SCROLL
478 PRINT 'PHONE N0.\A4<N,
25 TO 32)
488 SCROLL
498 SCROLL
588 NEXT N
RUN this program and enter live
names, addresses and phone numbers.
You are limited to 12 characters lor
the name, 12 characters lor the
address and 8 characters lor the
phone numbers. Purposely enter more
than this limit lor some ol the
items. You will notice later that
the computer will automatically
truncate them to the limited amount
ol characters.
Alter the tilth set is entered,
you will be given the instruction:
. __ ENTER TO
SEE VARIABLES m
Press ENTER and the variables
Hitt be displayed with the 32
numbers below then for identifying
the character positions. The numbers
start with 1 and go to 9 which is
followed by 0, f, 2 etc. The first
character of the 2 digit numbers is
omitted.
This entire program was written
with only two string variables and
yet we have three separate pieces of
information under program control.
Actually, these three pieces of
information are in only one string
variable.
CREATING DATA FIELDS
t previously mentioned Random
Access data manipulation methods.
These methods incorporate a
technique to create FIELDS within a
string variable. If you look at your
screen, you will see the data you
previously entered now formatted
into fields within single string
variables withing an array. The
array is the 5 total string
variables. The fields of each
variable are as follows;
character of the FIELD element will
take the next available positions in
the corresponding dimentionalized
string variable.
* all positions of the
dimensionalized string variable are
null spaces (blank) until they are
replaced with characters (line II
makes all the positions blank and
lines £0, 110 and 1£0 replaces these
blank spices with the data derived
from lines 50, 100 and 150).
- if the amount of characters of the
data to be inserted into a FIELD
position exceeds the amount of space
allowed, the data will be truncated
(chopped off) from its right side to
accommodate the space allowed.
- if the amount of characters of the
data to be inserted into a FIELD
position is LESS than the amount of
space allowed, blank spaces will
follow the data to take up the
remaining space.
Study these variables and the
positions of the characters in them.
You see the message at the bottom of
the screen;
PRESS ENTER TO SEE SEGMENTS :::
- character positions t through 12
represent the NAME information.
- character positions 13 through 24
represent the ADDRESS information.
- character positions 25 through 32
represent the PKCNE NUMBER
information.
FIELDING RULES
The following rules apply when
data is entered into these fields;
- the first character of the FIELD
item or element corresponds with the
first FIELD position assigned to
that element in the dimensionalized
string variable (line 10) by the
formatting program routine assigned
to that task nines £0, 111 and
l£0).
- all characters following the first
Do so and you will see alt of the
elements are broken out of the
string variables. Ife now have
demonstrated one method of putting a
bunch of elements into a single
string variable and breaking them
out again.
But in the (mortal words of that
famous and world reknowned
philosopher, Alfred E. Neuman, ‘You
Ain't Seen Nuttin' Yet*.
SORTING GY FIELDS
What you are about to see is an
extremely powerful string
manipulating technique, Add the
following routine to the last
program. CAUTION - DO NOT RtN THE
PROGRAM AFTER THIS ROUTINE IS
ENTERED!
510 SCROLL
520 SCROLL
1 ^
538 PRINT 'PRESS ENTER
TO CONTINUE
540 INPUT B*
m FAST
ill CLS
620 SLOW
430 PRINT 'UHICK FIELD 00 YOU
WANT TO SORT’,* (NAME -1/
ADDRESS -V PRONE -3)'
648 INPUT A
450 IF CODE STR$ A<29 OR CODE
STRi A>31 THEN GOTO 448
LLO, CACT
678 GOTO 408 ♦ <A»1I0>
780 LET Y * 1
718 LET 2 = 12
728 GOTO 1080
808 LET Y = 13
810 LET 2 = 24
820 GOTO 1008
908 LET Y = 25
916 LET 2 = 32
1000 CLS
1018 LET N * 5
1820 LET N = INT N/2
1030 IF N - 8 THEN 60T0 1200
1840 LET J = 1
1058 LET K - 5 - N
I860 LET I = J
1870 LET L = I ♦ N
1080 IF A*<I,Y TO 2)M»a,
Y TO 2) THEN GOTO 1150
1090 LET Bt = A«l)
1100 LET A0<1) = Aid)
1110 LET A»<L) = M
1120 LET 1 = I * N
1130 IF HI THEN GOTO 1150
1140 GOTO 1870
1158 LET J 3 J ♦ 1
1160 IF J>K THEN GOTO 1828
1170 GOTO 1068
1200 SLOU
1210 GOTO 210
You m ill notice that the above
routine is aliiost identical to the
SHELL SORT on pane II of the OCT/82
issue. Lines 1010 and 1058 have
changed the variable <B> to (5).
This variable and number correspond
with the total amount of strings to
be sorted.
Now ENTER (GOTO 218). Press ENTER
and the data you entered previously
should be displayed. Press ENTER
again and the FIELD ELEMENTS will be
displayed. Now press ENTER and
choose one of the fields yoo want
sorted. The following 2 displays
will show the data being sorted by
the comand you gave. If you chose
NAME - 1, the names will be in
alphabetical order. If address or
phone number were chosen, the string
variables would have been sorted by
those fields.
I might mention that 1 an not
aware of any other computer that
allows this format and speed to
accomplish this task and a program
could be written to allow as many
ELEMENT FIELDS per string variable
as the computer's memory would
allow.
This could he a very valuble
technique in writing an inventory
program and is used in the BILLPAYER
MACHINE of the HOME BUDGET package
marketed by SYNCHRD-SETTE.
This, by no means, is all that
can be done by manipulating string
variables. The techniques are only
limited by the programmer's
imagination.
For your homework, try to write a
program that has at least 12
elements per variable, 58 total
variables and allows a sort for any
element category.
HEY, YOU IN THE BACK! I TOLD YOU
TO PUT THAT YO-YO AWAY!
(.ED. RAMB. CONT.)
INDIANA USERS' GROUP
Robert DeLisle has started a
Sinclair computer club. For further
information contact:
CCC Users' Group
The Calumet Computer Club
1588 Beverly St.
Hamond, IN, 46324
1 S
The following is areview
hone budget program. Package
- 14,95 fron Synchro-Sette;
THE CHECKBOOK MACHINE
are coded tor checks, deposits and
bank service charges. It nistakes
are made, breakout to the main nenu
is possible and prompt <8> allows
editing.
This progran is suitable tor
applications from hone to nediun
size businesses. It is srlt running
and when loaded, the screen displays
the tol lowing nenu:
1 - TO ENTER TRANSACTIONS
2 - TO CREATE EXPENSE CATEGORIES
3 - TO SEE EXPENSE CATEGORIES
A - TO UST TRANSACTIONS
5 - BANK RECONCILIATION
i - TO SAVE DATA ON TAPE
7 - TO CLEAR TRANSACTIONS
8 - TO EDIT TRANSACTIONS
Extensive documentation is
included that covers almost every
conceivable checkbook situation.
To build a monthly data file, the
user first establishes the EXPENSE
CATEGORIES with pronpt <2>. As many
as 48 categories such as Pood,
Clothing, Rent, Utilities. Auto,
Insurance, etc. can be labelled. The
categories can always be reviewed at
any tine with pronpt (3).
After the categories are created,
pronpt < I > allows transactions to be
entered. The program will ask for
the first check number and will
automatically number the checks from
that point on. Transaction entries
Pronpt <4) allows the user use of
three routines:
1 - TO SEE TRANSACT! DNS
2 - TO SEE EXPENSE TOTALS
3 - TO SEE TRANSACTION TOTALS
Routine (1) scrolls all the
transactions as entered. Routine <2>
shows only the categories that
debits were written into and
displays their totals. Routine <3>
shows the totals amounts for checks,
deposits and bank service charges,
Prompt <5> from the main menu
allows the user to balance the
checkbook against the bank's
statement. A nice feature is the
entry method for outstanding checks.
Only the check numbers need be
entered. The program wilt
automatically cross-reference then
for the amounts against the ones in
memory. If the final total does not
equal the bank's statement total,
the nost probable areas for error
will be listed.
Prompt (7) allows the user to
start a new month's file by clearing
out all the transactions but LEADING
THE CATEGORIES INTACT. This
simplifies entry for the next month
1 <cS
(CHESS CONT.)
as the user goes directly to
entering the transactions.
Prompt <8> allows the user to
edit any mistakes made in an/
transaction entry and prompt <d>
allows any tile to be saved on tape,
whether it be a partial or tut!
month of entries.
E7-C7
23
H5-G4
B7-B5
24
Dl-Cl
F7-Fd
25
E5-F3
G5-E4
2d
C4xB5
AdxB5
27
F3-D2
E4xD2
20
D3xD2
G8-Dd
2?
C1-C5
Dd-05
38
D2-C2
THE BllLPAYER MACHINE
Simplicity itself to use, this
program allows the user to organize
unpaid bills in a data file that can
be constantly updated as old bills
are paid and new ones are entered.
Hurrah! Let Stack initiate the trade
and White still has the same biocide
with the chance to win a pawn.
D5xC5
31 C2xC5 G8-F?
32 G4-F3
Self running and menu driven, the
user needs only three items of
information to be entered:
1 - the date the bill is due
2 - the creditor's name
3 * the amount due
The user sits down at the
computer with all of the bills in
front of him or her and starts
entering the data. The program will
then sort the data and provide a
list with the oldest bill at the top
and the newest at the bottom.
As bills are paid, they can be
deleted or edited. If a bill is a
onetime debt, such as a magazine
subscription, once paid it can be
deleted completely. If it is a
regular bill with regular payment
amounts, the user can edit only the
date. Bills with date and amount
changes, such as utilities, can have
just those areas edited.
The sort routine is almost
instantaneous, and of course the
data can be stored on tape.
Wrong! G4-E2 would win either the
knight's pawn or the bishop's pawn
because after Black's C8-Ad, A3-A4
wins the pawn because of a double
pin. White ignores this potential on
its next move, also.
ra-iw
33 Gl-Fl F7-E7
34 F1-E2 E7-Dd
35 E2-D3 E6-E5
3d F3-E4 G7-G5
37 G2-G3 C7-E7
38 F2-F4 G5xF4
39 E3xF4 E5xD4
48 C5-F5 Cd- C5
Not the obvious- Superior move by
black to keep the pawn concentration
on the Queen side.
4] E4xB7 E?xB7
42 F5xFdeh Dd-D5
43 Fd-F5ch D5-W
44 F5-Fdch
The game is a draw. 1 set the levels
of both machines to higher
difficulties and the repetition went
on for 6 more moves. Either side has
the potential to Queen pawns and a
simple mistake could be disaster for
either White or Black.
A half point for each side. Final
score, 2x Master I 1/2 points,
Sargon 2 - 1/2 point.
?X Master is definitely one of
the stronger programs. Next month 2X
Master will be pitted against a
stronger program than Sargon 2,
2-Chess 3.
1 7 *